package com.shine.demo.leetCode.entity;

import lombok.Data;
import lombok.ToString;

public class ListNode {
    public int val;
    public ListNode next;

    public ListNode(int x) {
        val = x;
        next = null;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.val);
        while(null != this.next){
            sb.append("," );
            sb.append(next.val);
            next=next.next;
        }
        return sb.toString();
    }
}
